package com.zking.ssm.NH.service.impl;

import com.zking.ssm.NH.mapper.SysMenuMapper;
import com.zking.ssm.NH.model.SysMenu;
import com.zking.ssm.NH.service.ISysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Author NH
 * @Date 2021/1/19/0019 18:43
 */

@Service
public class SysMenuServiceImpl implements ISysMenuService {
    @Autowired
    private SysMenuMapper sysMenuMapper;

    @Override
    public List<SysMenu> menuList(SysMenu record) {
        List<SysMenu> sysMenus = sysMenuMapper.menuList(record);
        record.setNodes(sysMenuMapper.initList(record));
        return sysMenus;
    }

    @Override
    public SysMenu selectByPrimaryKey(Long menuId) {
        return sysMenuMapper.selectByPrimaryKey(menuId);
    }
}
